import {VueComponent, Component} from "modules";
import {Mutation, State, Action} from "vuex-class";
import IView from "interface/IView";

@Component({
  components: {},
})
export default class HomeMain extends VueComponent implements IView {
  @State("bottomState", {namespace: "Home"})
  public bottomState: any;
  @Mutation("setBottomState", {namespace: "Home"})
  public setBottomState: any;
  @Action("getList", {namespace: "Home"})

  public getList: any;
  public tableData: any;
  public account: any;
  public password: any;
  public constructor() {
    super();
    this. tableData = [{
      date: "2016-05-02",
      name: "王小虎",
      address: "上海市普陀区金沙江路 1518 弄",
    }, {
      date: "2016-05-04",
      name: "王小虎",
      address: "上海市普陀区金沙江路 1517 弄",
    }, {
      date: "2016-05-01",
      name: "王小虎",
      address: "上海市普陀区金沙江路 1519 弄",
    }, {
      date: "2016-05-03",
      name: "王小虎",
      address: "上海市普陀区金沙江路 1516 弄",
    }];
    this.account = "";
    this.password = "";
  }
  public created() {
    this.initData();
  }
  public async initData() {
    // TODO
  }
  public back() { /*ss*/ }
  public loginFn() {
    if (this.account === "" && this.password === "") {
      this.$message.error("账号或密码不正确");
      return false;
    }
    this.$message.success("登录成功");
    this.router.next("/home/main");
  }
}
